package com.xtinno.controller;

import cn.com.apollo.platformbase.response.ResponseResult;
import com.xtinno.pojo.dto.ElementReasoningDTO;
import com.xtinno.service.ElementReasoningService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;


/**
 * 要素推理
 *
 * @author GuanLei
 * @time 2025/5/21 19:34
 */
@Tag(name = "要素推理")
@RestController
@RequestMapping("/elementReasoning")
@RequiredArgsConstructor
public class ElementReasoningController {

    private final ElementReasoningService elementReasoningService;

    /**
     * 要素推理
     */
    @PostMapping(value = "/reasoning")
    public ResponseResult<Object> elementReasoning(@RequestBody ElementReasoningDTO elementReasoningDto) {
        Object result = elementReasoningService.elementReasoning(elementReasoningDto);
        return ResponseResult.ok(result);
    }


    @PostMapping(value = "/ruleImport")
    public ResponseResult<Boolean> elementReasoningRuleImport(@RequestParam("ruleFile") MultipartFile ruleFile){
        return ResponseResult.ok(elementReasoningService.elementReasoningRuleImport(ruleFile));
    }

}
